package br.com.basili.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;

@Entity
public class Metric
{
	@EmbeddedId
	private RelacaoProtocoloMetricaID    id;
	private String description;
	@OneToMany(mappedBy = "metric", cascade = CascadeType.ALL, fetch = FetchType.LAZY )
	private List<Question> questions = new ArrayList<Question>();
	
	public Metric( String description, List<Question> questions )
	{
		this.description = description;
		this.questions = questions;
	}
	
	public Metric( ) 
	{
		// TODO Auto-generated constructor stub
	}

	public String getDescription( ) 
	{
		return description;
	}
	
	public void setDescription( String description )
	{
		this.description = description;
	}
	
	public List<Question> getQuestions( )
	{
		return questions;
	}

	public void setQuestions( List<Question> questions )
	{
		this.questions = questions;
	}

	public RelacaoProtocoloMetricaID getId() {
		return id;
	}

	public void setId(RelacaoProtocoloMetricaID id) {
		this.id = id;
	}

}